package com.lzy.util;

import java.math.BigDecimal;
import java.util.Map;

public class CommUtil {
	
	public static int object2Int(Object obj){
		return ((BigDecimal)obj).intValue();
	}
	
	public static String Param2String(Map<String, Object> params,String key){
		Object object = null;
		if(params.containsKey(key) && params.get(key)!= null){
			object = params.get(key);
		}
		return object.toString();
	}
	
	public static int Param2Int(Map<String, Object> params,String key){
		Object object = null;
		int result ;
		if(params.containsKey(key) && params.get(key)!= null){
			object = params.get(key);
		}
		result = Integer.valueOf(object.toString()).intValue();
		return result;
	}
}
